<?php
  require_once '../../Helpers/DbHelper.php';
  require_once '../../Controllers/EnrolmentController.php';
  require_once '../../Controllers/SchoolController.php';
  require_once '../../Controllers/UserController.php';
  require_once '../../Helpers/PathHelper.php';

  $u = new UserController();
  $u->evaluatePagePermission(UserController::ADMINISTRATOR);
  //
  $e = new EnrolmentController();


?>
<html>
  <head>
    <title>School Enrollment :: Student Requirements</title>
    <?php
      require_once '../commons.php';
      renderHeaderStyles() ;
    ?>
    </head>
    <div class="admin-container">
         <?php renderAdminNav(); ?>
    </div>
  <div class="container" style="float:left">
    <h1>Add Requirements</h1>
    <form name="requirements-form" method="post">
      <table align="center" class="labels">
        <tr>
          <td><label for="requirement-name">Requirement Name:</label></td>
          <td><input type="text" name="requirement-name" /></td>
        </tr>
        <tr>
          <td><label for="student-type">Student Type:</label></td>
          <td>
          <select name="student-type">
            <option value="Non-transferee">Non-transferee</option>
            <option value="Transferee">Transferee</option>
          </select>
          </td>
        </tr>
        <tr>
          <td><input type="submit" name="add-requirements" value="Add Requirements" /></td>
        </tr>
      </table>
    </form>
    <hr />
      <form name="requirements-list" method="post" action="student_requirements.php?action=delete">
      <table cellspacing="5" align="center" class="table">
      <tr>
        <th>&nbsp;</th>
        <th width="150">Requirement Name</th>
        <th>Student Type</th>
      </tr>
      <?php
        if(mysql_num_rows($requirementsList) < 1)
          echo "<tr><td colspan='3'>No data available.</td></tr>";
        while($rows = mysql_fetch_assoc($requirementsList))
        {
          $requirementId = $rows['Id'];
          $requirementName = $rows['RequirementName'];
          $studentType = $rows['StudentType'];
          //
          echo "<tr>
            <td><input type='checkbox' name='requirementId[]' value='$requirementId' /></td>
            <td>$requirementName</td>
            <td>$studentType</td>
          </tr>";
        }
        echo "<tr><td><input type='submit' name='delete-fees' value='Delete Selected' />";
        echo "</tr>";
      ?>
    </table>
  </div>
</html>